package com.example.expandablelistview.dialog;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;

import com.example.expandablelistview.R;

public class AlertDialogBtn extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.alertdialogex);
	}

	public void mOnClick(View v) {
		if (v.getId() == R.id.commactivity_btn){
			new AlertDialog.Builder(this)
					.setTitle("알립니다.")
					.setMessage("대화상자를 열었습니다")
					.setIcon(R.drawable.ic_launcher)
					.setPositiveButton("닫기",
							new DialogInterface.OnClickListener() {
								public void onClick(DialogInterface dialog,
										int which) {
								}
							}).show();
		} else {
			new AlertDialog.Builder(this).setTitle("알립니다.")
					.setMessage("대화상자를 열었습니다").setIcon(R.drawable.ic_launcher)
					.setPositiveButton("확인", null)
					.setNegativeButton("취소", null).setNeutralButton("닫기", null)
					.show();
		}
	}
}
